<template>
  <div class="notice">
    <public-com></public-com>
    <h1>通知公告</h1>
    <div v-for="item in lists" :key="item.title">
      <router-link to="">
        <div class="box">
          <span class="title">{{ item.title }}</span>
          <span class="time">{{ item.time }}</span>
        </div>
      </router-link>
    </div>
    <footer-com></footer-com>
  </div>
</template>

<script>
import PublicCom from "@/components/PublicCom.vue";
import FooterCom from "@/components/FooterCom.vue";
import axios from "axios";
export default {
  components: {
    PublicCom,
    FooterCom,
  },
  data() {
    return {
      lists: [],
    };
  },
  created() {
    axios.get("api/Notice/getAll.do").then((result) => {
      // console.log(result.data);
      this.lists = result.data;
    });
  },

  methods: {
    // axios.post("api/Users/login.do", data).then((res) => {
    //     if (res.data == true) {
    //       console.log(1);
    //       sessionStorage.setItem("user",this.phone);
    //       this.$router.push("./subscribe");
    //     } else {
    //       this.error = "账号或密码错误";}
    //   });
  },
};
</script>

<style scoped>
.notice > h1 {
  margin: 50px;
}
.box {
  display: flex;
  justify-content: space-between;
  width: 70%;
  padding-left: 50px;
  height: 100px;
  margin: 0 auto;
  border-radius: 20px;
  background-color: #f5f5f5;
  margin-top: 50px;
}
.title,
.time {
  height: 100px;
  line-height: 100px;
  font-size: 17px;
  color: black;
}
.time {width: 200px;}
</style>
